export const saveToLocalStorage = (key,data) => {
    try{
        localStorage.setItem(key,JSON.stringify(data))
    } catch (e) {
        console.error(e)
    }
}

export const loadUserLocalStorage = (key) => {
    try{
        const data = localStorage.getItem(key)
        return data ? JSON.parse(data) : {username: "",password: "",phonenumber: "",}
    }catch(e){
        console.error(e)
        return {username: "",password: "",phonenumber: "",}
    }
}